package com.elong.qadev.service.impl;

import java.util.ArrayList;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.elong.qadev.dao.CaseDaoI;
import com.elong.qadev.entity.CaseNode;
import com.elong.qadev.service.CaseServiceI;

@Service("caseService")
public class CaseServiceImpl implements CaseServiceI {
	Logger logger = Logger.getLogger(CaseServiceImpl.class);
	@Autowired
	private CaseDaoI caseDao;
	
	@Override
	public ArrayList<CaseNode> getCases() {
		return caseDao.getAllHttpCaseNodes();
	}

	@Override
	public CaseNode save(CaseNode cn) {
		logger.info("运行MenuServiceImpl");
		
		return caseDao.save(cn);
	}

	@Override
	public boolean deleteNode(int id) {
		
		return caseDao.delete(id);
	}

	@Override
	public boolean updateNode(int id, String name) {
		
		return caseDao.update(id,name);
	}

	@Override
	public CaseNode getCase(int caseId) {
		return caseDao.getCase(caseId);
	}

	@Override
	public ArrayList<CaseNode> getWebuiCaseNodes() {
		return caseDao.getWebuiCaseNodes();
	}
}
